/*
 * @Author: nns4
 * @Date: 2019-10-31 17:32:13
 * @LastEditors: nns4
 * @LastEditTime: 2020-11-11 16:32:32
 * @FilePath: /studyNote/vue/src/router/routers.js
 * @Description: 路由配置
 *  @description: 路由配置
 *   meta: {
 *   title: "分类页",
 *   hideNav:false,  //隐藏底部导航 默认false
 *   hideBackTop:false //隐藏返回顶部 默认false
 *   pageCache:false   //页面是否缓存 默认false 
 * }
 */


import Home from "@v/home"
import classify from "@v/classify"
import shopCar from "@v/shopCar"
import me from "@v/me"
import test from "./test"

import ROUTERBASE from "./routerBeas"
let routerBeas = ROUTERBASE;
const routes = [{
  //首页
  path: routerBeas,
  name: 'home',
  component: Home,
  meta: {
    title: "首页",
    pageCache: true
  }
}, {
  //分类页
  path: `${routerBeas}classify`,
  name: 'classify',
  component: classify,
  meta: {
    title: "分类页"
  }
}, {
  path: `${routerBeas}detail`,
  name: 'detail',
  component: () => import('@v/detail'),
  meta: {
    title: route => `{{ params }}-${route.params.id}`,
    hideNav: true
  }

}, {
  //购物车
  path: `${routerBeas}shopCar`,
  name: 'shopCar',
  component: shopCar,
  meta: {
    title: "购物车",
    hideNav: true
  }
}, {
  //个人中心
  path: `${routerBeas}me`,
  name: 'me',
  component: me,
  meta: {
    title: "个人中心",
    hideBackTop: true,
    pageCache: true
  }
}, ...test, {
  path: '*',
  name: "error_404",
  component: () => import('@v/other/error_404.vue'),
  meta: {
    title: "404",
    hideNav: true,
    hideBackTop: true
  }
}]

export default routes